package sde.actor.railway;
import sde.actor.*;
import java.io.*;
import java.util.Scanner;

public class IncrocioFerroviario {
	public static void main( String[] args ){
		ControlMachine cm=new Realtime();
		SbarraIF sbarra=new Sbarra();
		ControlloreIF controller=new Controllore();
		sbarra.send( new SbarraIF.Init( controller, 3000 ) );
		controller.send( new ControlloreIF.Init(sbarra) );
		Scanner sc=new Scanner( System.in );
		String nomeFile=null;
		do{
		    System.out.print("Nome file dati sensori: ");
		    nomeFile=sc.nextLine();
		}while( !(new File(nomeFile).exists()) );
		Sensore s=new SensorePeriodico( controller, 500, new File(nomeFile) );
		cm.controller();
	}
}//IncrocioFerroviario
